<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<link rel="stylesheet" type="text/css" href="style2.css">
<!-- <link rel="stylesheet" type="text/css" href="bootstrap.min.css"> -->
<script type="text/javascript" src="viewCart.js">
</script>
</head>

<body>
<div id="wrap">
		<table>
			<tr>
				<td><a href="store"><img
						src="<c:url value='/images/logo.jpg'/>" height="100" width="100" class="hboxthumb" /></a></td>
				<td><h2 id="sitename">Welcome to Wai Mai Store!</h2></td>
			</tr>
		</table><br>
		Total number of items in your cart: <span id="shoppingCart">${sessionScope.nbrOfItems}</span><br><br>
		
		<c:if test="${sessionScope.nbrOfItems>0}">

			<table>
				<tr>
					<th></th>
					<th> Item Name </th>
					<th> Quantity </th>
					<th> Price </th>
					<th></th>
				</tr>
				<c:forEach var="item" items="${cart}">
					<tr id="${item.itemNumber}">
						<td><img src="<c:url value='${item.imagePath}'/>"
							height="100" width="100" class="hboxthumb"/></td>
						<td> ${item.name} </td>
						<td> ${item.quantity} </td>
						<td> ${item.price} </td>
						<td><input type="button" name="${item.itemNumber}"
							value="remove" onclick="deleteItem(${item.itemNumber})" /></td>
					</tr>
				</c:forEach>
				<tr>
					<td></td>
					<td></td>
					<td></td>
					<td>Total Price:</td>
					<td>${sessionScope.total}</td>
				</tr>
			</table>
		</c:if>
		<br>
		<input type="button" name="continueShopping"
							value="Continue ordering" onclick="goBackToHome()" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
							
		<input type="button" name="pay" value="Check Out" onclick="goToPaymentPage()" />
</div>
</body>
</html>
